/**
 * Created by Administrator on 2017/4/13.
 */

var config = require('../../config');
var request = require('request');
var model = require('../models/MovieSearchModel');
var movieDetailModel = require('../models/MovieDetailModel');
var appUtil = require('../../common/utils/appUtils');
var OAuth = require('wechat-oauth');
// var oauthDao = require('../dao/Oauth2RedisDao');
var oauthDao = require('../dao/OauthDao');
var appUtil = require('../../common/utils/appUtils');
var moment = require('moment');
var dao = require('../dao/LiveContentDao');

module.exports = {
    getLiveContentData: function (req, res) {
        // var date = moment().format('YYYYMMDD').toString();
        var page = req.query.page;
        dao.getLiveContentByType(page, function (result) {

            res.json({
                status: 'success',
                data: result
            })
        })
    },
    getLiveContentDataByType: function (req, res) {
        // var date = moment().format('YYYYMMDD').toString();
        var page = req.query.page;
        var type=req.query.type;
        dao.getLiveContentByTypeParam([type,page], function (result) {

            res.json({
                status: 'success',
                data: result
            })
        })
    },
    getLiveCategory: function (req, res) {

        dao.getLiveCategory(null, function (result) {

            if (result.isSuccess) {
                res.json({
                    status: 'success',
                    data: result.rows
                })
            } else {
                res.json({
                    status: 'fail'
                })
            }

        })

    }


}




